package wode.view;
import wode.controller.PlaneController;
import wode.entity.EnemyPlane;
import wode.entity.FightePlane;
import wode.entity.GameObject;
import wode.utils.*;
import javax.swing.*;

public class FrameWindow {
    public FrameWindow() {
        System.out.println("程序执行");
        lunch();
    }
    public void lunch() {
        FightePlane fightePlane=new FightePlane();
        GamePanel gamePanel=new GamePanel(fightePlane);
        PlaneController planeController=new PlaneController(fightePlane);
        //以下内容都是窗口的事情
        JFrame jFrame=new JFrame();
        jFrame.addKeyListener(planeController);//导入键盘执行的操作
        jFrame.add(gamePanel);//加入在窗口中才能执行
        jFrame.setTitle("广广的飞机大战");//标题
        jFrame.setVisible(true);//是否可视
        jFrame.setSize(p.width,p.height);//大小
        jFrame.setLocationRelativeTo(null);//本地内存
        jFrame.setResizable(false);//是否自动调节大小
        jFrame.setDefaultCloseOperation(jFrame.EXIT_ON_CLOSE);//点击叉叉关闭
    }
}